"""
@author: dfy
@file: 列表练习2.py
@time: 2024/5/26 15:27
"""


#约瑟夫船
#船30个人，给每个人编号1-30
#超载，下去10，数到第8个就下船，请问哪些人下船
lst1 = list(range(1,31))
lst2 = []
i=0
num = 0
while num != 10 :
    if (i+1)%8 != 0:
        lst1.append(lst1[i])
    else:
        lst2.append(lst1[i])
        num += 1
    i += 1
print(f"下船人员的编号为：{lst2}")
